/**我是中文**/
//alert("notifications");
document.getElementById('notifyButton').onclick = function () {
  //判断浏览器是否支持桌面通知插件
  if (window.Notification){
        //判断浏览器是否有通知的权限
        if(Notification.permission==='granted'){
          //创建桌面通知对象，创建时自动显示，不需要调用show方法。
          var notification = new Notification('Hello Notification',{
              icon:"/static/image/common/friends-logo.png",
              tag:'abcdefg',
              body:"I hope that all the browser will support this function!"});
          //点击通知后触发
          notification.onclick = function() {
              console.info("tag:"+this.tag);
              location.href="welcome.html"
              notification.close();
              window.focus();
					}
          //显示后触发，若果通知被点击跳转页面后，将不会触发哦
          notification.onshow = function(){
  					    setTimeout(function(){
  						    notification.close();
  					    },5000);
				  };
        }else {
          Notification.requestPermission();
        };
    }else {
      alert('你的浏览器不支持此特性，请下载谷歌浏览器试用该功能');
    }
}
